DevForce Help Reference
Or<T>(Expression<Func<T,Boolean>>,Expression<Func<T,Boolean>>) Method
Example 


First operand
Second operand
Returns an expression which represents a conditional OR operation.
Syntax

Parameters

left
First operand
right
Second operand

Type Parameters

T
Remarks
The resulting expression is an "OrElse" binary expression, where the second operand will be evaluated only if the first operand is true.
Example
public void OrQuery() {
  var mgr = new DomainModelEntityManager();
  Expression<Func<Customer, bool>> crit1 = c => c.Country.Equals("Mexico");
  Expression<Func<Customer, bool>> crit2 = c => c.CompanyName.StartsWith("A");

  // Where companyname starts with A or country = mexico
  var finalcrit = crit1.Or(crit2);
  var query = mgr.Customers.Where(finalcrit);
  var list = query.ToList();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PredicateBuilder Class
PredicateBuilder Members
Overload List

Send Feedback